#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Endless loop
import multiprocessing
import threading


def loop():
    
    n = 0
    while True:
        n = n ^ 1
        # print(n)

for i in range(multiprocessing.cpu_count()):
    t = threading.Thread(target=loop)
    t.start()
    print('start thread {}'.format(i))
    t.join()
